@echo off
for /l %%i in (101,1,120) do ping 172.16.100.%%i /n 2 /w 1 || echo 172.16.100.%%i >> %userprofile%\desktop\err.txt
for /l %%i in (240,1,247) do ping 192.168.20.%%i /n 2 /w 1 || echo 192.168.20.%%i >> %userprofile%\desktop\err.txt